package com.macro.mall.model;

import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * ums_service_dept_log实体类
 *
 * @author gaodx
 *
 */
@Data
@Builder
@AllArgsConstructor
public class UmsServiceDeptLog implements Serializable{
	/***/
    @ApiModelProperty(value = "")
	private Integer id; 
	/**机构id*/
    @ApiModelProperty(value = "机构id")
	private Integer deptId; 
	/**操作人id*/
    @ApiModelProperty(value = "操作人id")
	private String operatorId; 
	/**操作人名称*/
    @ApiModelProperty(value = "操作人名称")
	private String operatorName; 
	/**操作时间*/
    @ApiModelProperty(value = "操作时间")
	private Date operatorTime; 
	/**01-未合作 02-合作中 03-审核中'*/
    @ApiModelProperty(value = "01-未合作 02-合作中 03-审核中'")
	private String oldStatus; 
	/**01-未合作 02-合作中 03-审核中'*/
    @ApiModelProperty(value = "01-未合作 02-合作中 03-审核中'")
	private String newStatus; 
	/**备注*/
    @ApiModelProperty(value = "备注")
	private String remarks; 
	/**1-课程机构 2-服务机构*/
    @ApiModelProperty(value = "1-课程机构 2-服务机构")
	private String type; 
	/**修改时间*/
    @ApiModelProperty(value = "修改时间")
	private Date updateTime; 
	/**
	 * 实例化
	 */
	public UmsServiceDeptLog() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public UmsServiceDeptLog(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).intValue());
		}
		if (obj.get("deptId") instanceof Number) {
			this.setDeptId(((Number) obj.get("deptId")).intValue());
		}
		if (obj.get("operatorId") instanceof String) {
			this.setOperatorId((String) obj.get("operatorId"));
		}
		if (obj.get("operatorName") instanceof String) {
			this.setOperatorName((String) obj.get("operatorName"));
		}
		this.setOperatorTime((Date) obj.get("operatorTime"));
		if (obj.get("oldStatus") instanceof String) {
			this.setOldStatus((String) obj.get("oldStatus"));
		}
		if (obj.get("newStatus") instanceof String) {
			this.setNewStatus((String) obj.get("newStatus"));
		}
		if (obj.get("remarks") instanceof String) {
			this.setRemarks((String) obj.get("remarks"));
		}
		if (obj.get("type") instanceof String) {
			this.setType((String) obj.get("type"));
		}
		this.setUpdateTime((Date) obj.get("updateTime"));
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getDeptId() != null) {
			result.put("deptId",this.getDeptId());
		}
		if (this.getOperatorId() != null) {
			result.put("operatorId",this.getOperatorId());
		}
		if (this.getOperatorName() != null) {
			result.put("operatorName",this.getOperatorName());
		}
		if (this.getOperatorTime() != null) {
			result.put("operatorTime",this.getOperatorTime());
		}
		if (this.getOldStatus() != null) {
			result.put("oldStatus",this.getOldStatus());
		}
		if (this.getNewStatus() != null) {
			result.put("newStatus",this.getNewStatus());
		}
		if (this.getRemarks() != null) {
			result.put("remarks",this.getRemarks());
		}
		if (this.getType() != null) {
			result.put("type",this.getType());
		}
		if (this.getUpdateTime() != null) {
			result.put("updateTime",this.getUpdateTime());
		}
		return result;
	}


	@Override
	public String toString() {
		return "UmsServiceDeptLog [id=" + id + " , deptId=" + deptId + " , operatorId=" + operatorId + " , operatorName=" + operatorName + " , operatorTime=" + operatorTime + " , oldStatus=" + oldStatus + " , newStatus=" + newStatus + " , remarks=" + remarks + " , type=" + type + " , updateTime=" + updateTime + "  ]";
	
	}
	
	
}
